/**
 * 活动界面
 */
class ActivityUI extends UIBase{
    private btn_back:BaseButton;

    private inviteActivityInfo;
    private foodActivityInfo;
    private activityFoodComp:ActivityFoodUI;
    constructor()
    {
        super('ActivityView',{showBG:true})
    }

    public init()
    {
        super.init(true);
        this.foodActivityInfo = {
            lunchInfo:{},
            dinnerInfo:{}
        }
        ActivityPrase.instance().requestActivityInfo(this.initUI, this);
    }

    public initUI(ActivityInfo)
    {
        if(ActivityInfo)
        {
            this.inviteActivityInfo = ActivityInfo.invite;
            this.foodActivityInfo.lunchInfo = ActivityInfo.lunch;
            this.foodActivityInfo.dinnerInfo = ActivityInfo.dinner;

            this.activityFoodComp.initUI(this.foodActivityInfo);
        }
    }

    public addEvent()
    {
        this.btn_back.addTapHandler(this.close, this);
    }

    public close()
    {
        this.remove(3);
    }

    public removeEvent()
    {
        this.btn_back.removeTapHandler();
    }

    public clear()
    {
        super.clear();
    }
}